<#
.SYNOPSIS
Check Student Management System status

.DESCRIPTION
This script checks the status of Student Management System containers without requiring administrator privileges.

.NOTES
Requires Docker to be installed and running
#>

# Check if Docker is available
Write-Host "Checking Docker availability..."
if (-not (Get-Command "docker" -ErrorAction SilentlyContinue))
{
    Write-Host "Docker not found. Please install Docker Desktop and try again."
    Exit
}

# Check if Docker is running
try {
    docker info > $null
    Write-Host "Docker is running."
} catch {
    Write-Host "Docker is not running. Please start Docker Desktop and try again."
    Exit
}

# Check system containers
Write-Host "\nChecking system containers status..."
docker ps --filter "name=student-management-"

# Display login information
Write-Host "\nSystem default accounts:"
Write-Host "- Admin: admin / Admin@123"
Write-Host "- Teacher: teacher / Teacher@123"
Write-Host "- Student: student / Student@123"

# Display access URLs
Write-Host "\nAccess URLs:"
Write-Host "- Backend API Docs: http://localhost:5000/swagger/index.html"
Write-Host "- Frontend Application: http://localhost:80"

# Display useful commands
Write-Host "\nUseful commands:"
Write-Host "1. To start the system:"
Write-Host "   cd docker && docker-compose up -d"
Write-Host ""
Write-Host "2. To stop the system:"
Write-Host "   cd docker && docker-compose down"